#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

template<typename T=int>
inline T read() {
    T x;
    cin >> x;
    return x;
}

double eval(string exp) {
    istringstream iss(exp);
    stack<double> S;
    for (string tok; iss >> tok;) {
        double x;
        istringstream iss2(tok);
        if (iss2 >> x) {
            S.push(x);
        } else {
            if (S.size() < 2)return -1;
            double b = S.top();
            S.pop();
            double a = S.top();
            S.pop();
            switch (tok[0]) {
                case '+':
                    S.push(a + b);
                    break;
                case '-':
                    S.push(a - b);
                    break;
                case '*':
                    S.push(a * b);
                    break;
                case '/':
                    S.push(a / b);
                    break;
                default:
                    break;
            }
        }
    }
    return S.size() == 1 ? S.top() : -1;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    string exp;
    getline(cin, exp);
    cout << fixed << setprecision(2) << eval(exp) << endl;

    return 0;
}
//stl stack计算逆波兰式 注意判断输入的符号是数字还是运算符 istringstream